function ResponseReader(s, denc, responseHead) {

	this.readValues = function() {
		var c = new ContentHead(responseHead);
		
		if(!c.containsContentLength()) throw "Content-Length must be present";
		if(responseHead.getStatusCode() != 200) throw TITTValues.getResponse(responseHead.getStatusCode());

		return decode(s.getInputStream().read(c.getContentLength()),responseHead);	
	}

	function decode(data, responseHead) {

		var ret;
		
		var t = new Type(responseHead.getContentType());
		
		if(!denc.isDecodeable(t)) 
			ret = new TypedObject(t,null);
		else
			ret = new TypedObject(t, denc.decode(t, data));
 
		
		return [ret];
		
	}
}
